import { createRouter, createWebHashHistory } from 'vue-router';

export default createRouter({
  history: createWebHashHistory(),
  routes: [
    {
    // 主页
      path: '/',
      // 路由重定向 重定向到 /home
      // redirect: '/home',
      component: () => import('@/views/home/index.vue'),
      children: [
        // homePage
        {
          path: '/',
          component: () => import('@/views/home/pages/homePage/index.vue'),
        },
        // moviePage
        {
          path: '/moviePage',
          component: () => import('@/views/home/pages/moviePage/index.vue'),
        },
        // cinemaPage
        {
          path: '/cinemaPage',
          component: () => import('@/views/home/pages/cinemaPage/index.vue'),
        },
        // userPage
        {
          path: '/userPage',
          component: () => import('@/views/home/pages/userPage/index.vue'),
        }
      ],
    },
    {
    // 登录
      path: '/login',
      component: () => import('@/views/login/index.vue'),
    },
    // homePage/search
    {
      path: '/searchAll',
      component: () => import('@/views/home/pages/searchAll/index.vue'),
    },
],
});
